﻿#if UNITY_EDITOR
using System;
using UnityEngine;
/// <summary>
/// 路径选择目录分类
/// </summary>
public enum enESF_PathSelectCatalogClassify
{
    /// <summary>
    /// Assets目录内
    /// </summary>
    [ESF_AliasTooltip("Assets目录内")]
    InternalAssets = 1 << 0,
    /// <summary>
    /// Assets目录外
    /// </summary>
    [ESF_AliasTooltip("Assets目录外")]
    OuterAssets = 1 << 1,
}

/// <summary>
/// 路径选择资源分类
/// </summary>
public enum enESF_PathSelectAssetClassify
{
    /// <summary>
    /// 文件
    /// </summary>
    [ESF_AliasTooltip("文件")]
    File = 1 << 0,
    /// <summary>
    /// 文件夹
    /// </summary>
    [ESF_AliasTooltip("文件夹")]
    Folder = 1 << 1,
}

/// <summary>
/// 路径选择特性
/// </summary>
[AttributeUsage(AttributeTargets.Field, Inherited = true, AllowMultiple = false)]
public class ESF_PathSelectAttribute : PropertyAttribute
{
    /// <summary>
    /// 构造函数
    /// </summary>
    /// <param name="_catalogClassify">目录分类</param>
    /// <param name="_assetClassify">资源分类</param>
    /// <param name="_legalAssetExts">合法资源后缀</param>
    public ESF_PathSelectAttribute(enESF_PathSelectCatalogClassify _catalogClassify = 0,
        enESF_PathSelectAssetClassify _assetClassify = 0, params enESF_UnityFileExt[] _legalAssetExts)
    {
        catalogClassify = _catalogClassify;
        assetClassify = _assetClassify;
        legalAssetExts = _legalAssetExts;
    }

    /// <summary>
    /// 目录分类
    /// </summary>
    public enESF_PathSelectCatalogClassify catalogClassify { get; private set; }
    /// <summary>
    /// 资源分类
    /// </summary>
    public enESF_PathSelectAssetClassify assetClassify { get; private set; }
    /// <summary>
    /// 合法资源后缀
    /// </summary>
    public enESF_UnityFileExt[] legalAssetExts { get; private set; }
}
#endif
